<?php
namespace Core\CoreComponents\UsersManager;

/**
* This interface provide all accessible methods on Users module
*
* @method ServiceResponse authenticate($login, $password)
* @method ServiceResponse getUsers()
*/
interface IUsers
{
	/**
	* Authenticate an user
	* 
	* @param string $login The user's login 
	* @param string $password The user's password 
	*
	* @return This response contains the use object
	*/
    public function authenticate($login, $password);
	
	/*
	* Check the user authorization
	*
	* @param int $userid The user unique identifier
	*
	* @return ServiceResponse This response contains the user object or null
	*/
	public function checkUserAuthorization($userid);
	
	/*
	* Update users's informations
	*
	* @param int $id The unique identifier of a user
	* @param string $firstname The user's firstname 
	* @param string $lastname The user's lastname 
	* @param string $email The user's email 
	* @param string $phonenumber The user's phonenumber 
	* @param string $login The user's login 
	*
	* @return ServiceResponse This response contains the updated user
	*/
	public function updateUserInformations($id, $firstname, $lastname, $company, $email, $phonenumber, $webaddress, $login);

	/*
	* Update users's informations
	*
	* @param int $id The unique identifier of a user
	* @param string $newPassword The user's new password 
	*
	* @return ServiceResponse This response contains the updated user
	*/
	public function updateUserPassword($id, $newPassword);
	
	/*
	* Set user as online
	*
	* @param int $userid The user unique identifier
	*
	* @return ServiceResponse This response contains the user 
	*/
	public function setUserAsOnline($userid);
	
	/*
	* Update an user
	*
	* @param int $id The unique identifier of a user
	* @param string $firstname The user's firstname 
	* @param string $lastname The user's lastname 
	* @param string $email The user's email 
	* @param string $phonenumber The user's phonenumber 
	* @param string $login The user's login 
	* @param string $password The user's password 
	* @param int $profile The user's profile 
	*
	* @return ServiceResponse This response contains the updated user
	*/
	public function updateUser($id, $firstname, $lastname, $company, $email, $phonenumber, $webaddress, $login, $profile);
	
	/**
	* Attach a avatar on an user
	*
	* @param int $idUser The user id
	* @param binary[] $file The avatar file
	* @param string $mime The avatar file mime type
	* @param string $extension The avatar file extension
	* 
	* @return ServiceResponse This response contains the user with his avatar
	*/
	public function attachAvatarOnAnUser($idUser, $file, $mime, $extension);
	
	/**
	* Set user as offline
	*
	* @param int $userid The user unique identifier
	*
	* @return ServiceResponse This response contains the user 
	*/
	public function setUserAsOffline($userid);
	
	/**
	* Get online users
	*
	* @return ServiceResponse This response contains all online users
	*/
	public function getOnlineUsers();
	
	/**
	* Get all users
	*
	* @return This response contains all users
	*/
	public function getUsers();
	
	/**
	* Get all user more or upper members
	*
	* @return ServiceResponse This response contains users with member profile minimum
	*/
	public function getUsersMemberMinimum();
	
	/**
	* Add an user
	*
	* @param string $firstname The user's firstname 
	* @param string $lastname The user's lastname 
	* @param string $company The user's company 
	* @param string $email The user's email 
	* @param string $phonenumber The user's phonenumber 
	* @param string $webaddress The user's webaddress 
	* @param int $profile The user's profile 
	*
	* @return ServiceResponse This response contains the added user
	*/ 
	public function addUser($firstname, $lastname, $company, $email, $phonenumber, $webaddress, $profile);
	
	/*
	* Add a new user
	*
	* @param string $firstname The user's firstname 
	* @param string $lastname The user's lastname 
	* @param string $email The user's email 
	*
	* @return ServiceResponse This response contains the added user
	*/
	public function addNewUser($firstname, $lastname, $email);
	
	/*
	* Add a new member
	*
	* @param string $firstname The user's firstname 
	* @param string $lastname The user's lastname 
	* @param string $email The user's email 
	* @param string $object The user's object 
	* @param string $message The user's message 
	*
	* @return ServiceResponse This response contains the added user
	*/
	public function demandNewMember($firstname, $lastname, $email, $object, $message);
	
	/*
	* Send a contact mail
	*
	* @param string $firstname The user's firstname 
	* @param string $lastname The user's lastname 
	* @param string $email The user's email 
	* @param string $object The user's object 
	* @param string $message The user's message 
	*
	* @return ServiceResponse This response contains the added user
	*/
	public function sendContact($firstname, $lastname, $email, $object, $message);
	
	/*
	* valid an user
	*
	* @param string $password The user's password 
	*
	* @return ServiceResponse This response contains the validate user
	*/
	public function validUserEmail($password);
	
	/**
	* Get all profiles
	*
	* @return This response contains all profiles
	*/
	public function getProfiles();
	
	/*
	* Delete an user
	*
	* @param int $id The user's identifier 
	*
	* @return ServiceResponse This response contains the added user
	*/
	public function deleteUser($id);
	
	/*
	* Get an user
	*
	* @param int $id The user's identifier 
	*
	* @return ServiceResponse This response contains the user
	*/
	public function getUser($id);
	
	/*
	* Reset user password
	*
	* @param int $userid The user unique identifier
	*
	* @return ServiceResponse This response contains the user object or null
	*/
	public function resetUserPassword($userid);
}

?> 